package com.prb.proivder.one.provider;

import com.prb.common.config.RpcConfig;
import com.prb.common.service.UserService;
import com.prb.proivder.one.config.AppConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;

public class ProviderMain {


    public static void main(String[] args) throws IOException {

        RpcConfig.serverSide = "server";

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.register(AppConfig.class);
        context.scan("com.prb.register" , "com.prb.provider.service" , "com.prb.provider.server");
        context.refresh();

        Object person1 = context.getBean("person1");
        System.out.println(person1);

        UserService bean = context.getBean(UserService.class);

        System.out.println(bean);


        System.in.read();

    }
}
